import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/manager/login',
    method: 'post',
    data
  })
}

// export function getInfo(token) {
//   return request({
//     url: '/vue-element-admin/user/info',
//     method: 'get',
//     params: { token }
//   })
// }

export function logout() {
  return request({
    url: '/user/manager/logout',
    method: 'post'
  })
}

// 用户列表
export function queryUserList(query) {
  return request({
    url: '/app/user/manage/queryUserList',
    method: 'get',
    params: query
  })
}

// 用户详情
export function userDetail(id) {
  return request({
    url: `/app/user/manage/detail/${id}`,
    method: 'get'
  })
}


//获取消费记录
export function queryConsumptionRecords(query) {
  return request({
    url: `/app/user/manage/queryConsumptionRecords`,
    method: 'get',
    params: query
  })
}

// 下级推广员
export function queryLowerLevelPromoters(query) {
  return request({
    url: `/app/user/manage/queryLowerLevelPromoters`,
    method: 'get',
    params: query
  })
}

// 余额流水
export function queryBalanceFlow(query) {
  return request({
    url: `/app/user/manage/queryBalanceFlow`,
    method: 'get',
    params: query
  })
}

// 直推佣金
export function queryDirectCommission(query) {
  return request({
    url: `/app/user/manage/queryDirectCommission`,
    method: 'get',
    params: query
  })
}

// 间推佣金
export function queryIndirectCommission(query) {
  return request({
    url: `/app/user/manage/queryIndirectCommission`,
    method: 'get',
    params: query
  })
}
//讲师活动佣金
export function queryActivityCommission(query) {
  return request({
    url: `/app/user/manage/queryActivityCommission`,
    method: 'get',
    params: query
  })
}